package com.example.java0317springboot.iocdemo;

import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.stereotype.Component;

import javax.annotation.Resource;

@Component
public class House {
    @Qualifier("Haide")
    @Resource
    private AC ac;

    @Qualifier("Houye")
    @Resource
    private TV tv;


    public void openDoor() {
        System.out.println("打开房门");
        ac.air();
        tv.tele();
    }

    public AC getAC() {
        return ac;
    }

    public  void setAC(AC ac) {
       this.ac = ac;
    }

    public TV getTV() {
        return tv;
    }

    public  void setTV(TV tv) {
        this.tv = tv;
    }


    @Override
    public String toString() {
        return "House{" +
                "ac='" + ac + '\'' +
                ", tv='" + tv + '\'' +
                '}';
    }


}
